﻿using System;

namespace b2
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = 0;
            double max = 0;
            double min = 0;
            double aver = 0;
            double sum = 0;
            double tem = 0;

            while (num <= 0)
            {
                Console.WriteLine("请输入数组总数值数:");
                num = Convert.ToInt32(Console.ReadLine());
            }
            for (int i = 0; i <num; i++)
            {
                Console.WriteLine("请输入第" + (i + 1) + "个数值：");
                tem = Convert.ToInt32(Console.ReadLine());
                if (i == 0)
                {
                    max = tem;
                    min = tem;
                }
                if (max < tem)
                {
                    max = tem;
                }
                if (min > tem)
                {
                    min = tem;
                }
                sum = sum + tem;
            }
            aver = sum / num;
            Console.WriteLine("数组最大值为：" + max);
            Console.WriteLine("数组最小值为：" + min);
            Console.WriteLine("数组平均值为：" + aver);
            Console.WriteLine("数组和为：" + sum);
            Console.ReadLine();
        }
    }
}
